Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ (signer-btc) [DSDK-471]: SignPsbt task #581

Merged
merged 14 commits into from
Jan 14, 2025

Conversation

jdabbech-ledger
Copy link
Contributor

@jdabbech-ledger jdabbech-ledger commented Dec 27, 2024

📝 Description

  • Create CommandErrorHelper to handle command error codes in parse response
  • Refactor SignMessage with ContinueTask
  • Create SignPsbt task & DA
  • Update sample app with Sign Psbt
sign_psbt.mp4

❓ Context

  • Feature:

✅ Checklist

Pull Requests must pass CI checks and undergo code review. Set the PR as Draft if it is not yet ready for review.

  • Covered by automatic tests
  • Changeset is provided
  • Impact of the changes:
    • list of the changes

🧐 Checklist for the PR Reviewers

  • The code aligns with the requirements described in the linked JIRA or GitHub issue.
  • The PR description clearly documents the changes made and explains any technical trade-offs or design decisions.
  • There are no undocumented trade-offs, technical debt, or maintainability issues.
  • The PR has been tested thoroughly, and any potential edge cases have been considered and handled.
  • Any new dependencies have been justified and documented.

@jdabbech-ledger jdabbech-ledger requested a review from a team as a code owner December 27, 2024 17:42
Copy link

vercel bot commented Dec 27, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
device-sdk-ts-sample ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 14, 2025 10:21am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
doc-device-management-kit ⬜️ Ignored (Inspect) Visit Preview Jan 14, 2025 10:21am

Copy link
Contributor

github-actions bot commented Dec 27, 2024

Messages
Danger: All checks passed successfully! 🎉

Generated by 🚫 dangerJS against 1fdb8fa

},
initialValues: {
derivationPath: DEFAULT_DERIVATION_PATH,
psbt: "70736274ff0104010101fb0402000000010204020000000105010100011004000000000103040100000001007102000000013daeeb9a92e7b5af90c787d53f0e60d2cf4cfd47bca9a0d8bc77a7464b024c0b00000000000000000002ff0300000000000016001402fe597c6ec0e2982712929bcf079a4e11d37e8d950b0000000000001600144dc432cb6a26c52a1e6ddd2bcf0ee49199fae0cc000000002206031869567d5e88d988ff7baf6827983f89530ddd79dbaeadaa6ec538a8f03dea8b18f5acc2fd540000800000008000000080000000000000000001011fff0300000000000016001402fe597c6ec0e2982712929bcf079a4e11d37e8d010e200cf08d04fa11ff024d5a50165ba65e495409b50ba6657788dfa15274adb682df010f0400000000000103086b01000000000000010416001429159115f12bb6a7e977439c83d3f8d555d72d5f00",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[COULD] Remove the default psbt here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, it's a heartache after so much difficulties to create it 😿


export type SignPsbtDAInternalState = {
readonly error: SignPsbtDAError | null;
// [SHOULD] be psbt instead of signature
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[ASK] What to do with this comment ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The next task I'm working on, UpdatePsbtTask, will modify this device action to return a psbt instead of a Signature

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually as discussed, we won't return a PSBT but the list of signature, with according index/tag/pubkey_augm (typing to be refined)

{
constructor(private readonly args: GetWalletAddressCommandArgs) {}
constructor(
private readonly args: GetWalletAddressCommandArgs,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[COULD] rename args to _args

@@ -41,19 +37,26 @@ export type SignMessageCommandArgs = {
readonly messageMerkleRoot: Uint8Array;
};

export type SignMessageCommandResponse = Signature | ApduResponse;
export type SignMessageCommandResponse = ApduResponse;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[ASK] Why returning an ApduResponse instead of a Signature ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To handle the signature only in the task, with a client interpreter flow as the it should respond with those client commands.

Copy link
Contributor

@paoun-ledger paoun-ledger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@jdabbech-ledger jdabbech-ledger added this pull request to the merge queue Jan 14, 2025
Merged via the queue into develop with commit 1c2a424 Jan 14, 2025
10 checks passed
@jdabbech-ledger jdabbech-ledger deleted the feat/dsdk-471-sign-psbt-task branch January 14, 2025 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants